﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using USpell.Models;

namespace USpell.ViewModels
{
    /// <summary>
    /// 我要猜 viewmodels 数据提供引擎
    /// </summary>
    public class VMGuessFrom : ViewModelBase
    {
        private ObservableCollection<Guess> myGuesses;

        /// <summary>
        /// 我要猜 数据集合
        /// </summary>
        public ObservableCollection<Guess> MyGuesses
        {
            get
            { 
                return myGuesses; 
            }
            set
            {
                myGuesses = value;
                RaisePropertyChanging("MyGuesses");
            }
        }

        /// <summary>
        /// 获取所有给我的猜题
        /// </summary>
        public void GetAllGuessFrom()
        {
            var re = USpell.API.Core.GetAllGuessFromFriend();
            if (re != null)
            {
                MyGuesses = new ObservableCollection<Guess>(re);
            }
        }
    }
}
